<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>我的订单(待付款)</title>
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1" />
<meta name="format-detection" content="telephone=no, email=no" />
<link rel="stylesheet" href="{{ url('/common/mobile-common/common.css') }}">		
<link rel="stylesheet" href="{{ url('/mobile/css/order/common.css') }}">		
<link rel="stylesheet" href="{{ url('/mobile/css/order/order-unpay.css') }}">	
<script src="{{ url('mobile/js/jquery-1.8.3.min.js') }}"></script>
<script src="{{ url('/common/mobile-common/hmt.js') }}"></script>
</head>
<body>
	<div class="abouts">
		<div class="wrap-cont clearfix">
				<!--收货地址-->
				<div class="address clearfix">
					<img src="{{ url('mobile/images/addreee.png') }}" class="dw-icon">
					<p>
						<span class="dz1">{{$res->receiver}}</span>
						<span class="dz2">{{$res->phone}}</span>
						<em>{{$res->province}}&nbsp{{$res->city}}&nbsp{{$res->address}}</em>
					</p>
				</div>
				<!--end-->
				
				
				<!--订单内容 等待买家付款-->
				<div class="wap-cont unpayment" id="wrapper">
					<div id="scroller">						
						<ul>
							<li>
								<div class="orders">
								<p class="order-num">
									<span class="logg"><img src="{{ url('mobile/images/logo2.png') }}"></span>
									<em>{{App\Http\Util\OrderStatus::getLabel($res->status)}}</em>
								</p>
								@foreach($detail as $v)
								<div class="orer-info clearfix">
									<img src="{{ config('config.picHostPrefix').$v->img }}">
									<p class="card-style">
										<span>{{$v->good_name}}</span>
										<em>类型:{{$v->type_name}}</em>
									</p>
									<p class="pri-num">
										<span>¥{{$v->price}}</span>
										<em>x1</em>
									</p>
								</div>
								@endforeach
								<p class="order-all order-jg">
									<span>运费<em>¥0.00</em></span>
									@if($res->promote_type==1&&$effect)
										<span>满{{$effect}}<em>-¥{{$cheap}}</em></span>
									@endif
									@if($res->promote_type==2&&$effect2)
										<span>满{{$effect2}}<em>送卡{{$num}}张</em></span>
									@endif
								</p>
								<p class="order-all-price">
									<span>实付款:</span>
									<em>¥{{$res->total_price}}</em>
								</p>
								</div>	
							</li>
						</ul>
					</div>
					
													
					<!--end-->
					<!--订单详细信息-->
					<div class="dd-information">
						<div>
							<p>订单号: {{$res->order_num}}</p>
							<p>下单时间:{{App\Http\Util\TimeHelper::formatDateTime($res->order_time)}}</p>
						</div>
					</div>
					<!--付款-->
					<div class="all-price clearfix">
						<p>
							<span>合计: <i>¥{{$res->total_price}}</i></span>
							{{--<em><i><img src="{{ url('mobile/images/sj-icon.png') }}"></i>剩15分钟自动关闭</em>--}}
						</p>
						<div>
							<a href="javascript:void(0)" class="unopt">取消订单</a>
							<a href="{{url('wap/order/payWay/'.$res->id)}}" class="gopay">去付款</a>
						</div>
					</div>
				</div>
				<!--end-->
				<!--弹窗-->
				<div class="tc">
					<div class="bgg"></div>
					<div class="tc-info">
						<p class="sf">您是否确定要付款？</p>
						<p class="cz">
							<a class="qx">取消</a>
							<a class="qd" value="1">确定</a>
						</p>
					</div>	
				</div>
				
				
		</div>
	</div>
	
</body>
<script>
	$(function(){
		$(".all-price .gopay").click(function(){
			$(".tc").show();
		});
		$(".tc-info a").on("touchstart",function(){
			var thisVal=$(this).attr("class");
			if(thisVal=="qx"){
				$(".tc").hide();
			}
			else {
				//跳转支付
			}
		});

		$(".unopt").click(function(){
			var id = "{{$res->id}}";
			if(confirm("确认取消吗？")) {
				$.ajax({
					url: "{{ url('wap/order/deleteOrder') }}",
					type: "post",
					dataType: "json",
					data: {id: id},
					success: function (data) {
						if (data.success) {
							location.reload();
						}
						else {
							layer.alert(data.msg);
						}
					}
				})
			}
		});
	});
</script>
</html>
